<?php 
	echo $this->Form->create(false, array(
		'type' => 'POST',
		'id' => 'oathLogin',
		'url' => API_SERVER . 'oauth/authorize' . '?app_key=' . APP_KEY . '&amp;app_secret=' . APP_SECRET .
				 '&amp;callbackURL=' . (env('HTTPS') ? 'https://' : 'http://') .  env('SERVER_NAME') . Router::url(array('controller' => 'user', 'action' => 'ajax_login'))
	));
	
	echo $this->Form->input('Username', array('name' => 'Username', 'id' => 'Username'));
	echo $this->Form->input('Password', array('name' => 'Password', 'id' => 'Password'));
	echo $this->Form->submit('OK');
	echo $this->Form->end();
?>
<?php if (isset($loginMode) && $loginMode): ?>
<script type="text/javascript">
	window.onload = function() {
		//document.getElementById('oathLogin').submit();
	}
</script>
<?php endif; ?>
